/*
 * @Author: yongtian.hong
 * @Date: 2019-01-09 19:52:13
 * @LastEditors: yongtian.hong
 * @LastEditTime: 2019-01-10 16:19:44
 * @Description: 路由聚合
 */
import Vue from "vue";
import Router from "vue-router";

// 搭配页面
import collocate from "./collocate";

// 路由注册
Vue.use(Router);

const router = new Router({
  // 搭配页面
  routes: [...collocate]
});
// 路由跳转钩子
router.beforeEach((to, from, next) => {
  console.log("to", to);
  console.log("from", from);
  document.title = to.meta.title;
  next();
});

// 导出路由在 main.js 里使用
export default router;
